import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class TestFile {


    public static class IODemo1 {
        private static File InputStream=new File("D:/test.txt");

        public static void main(String[] args) throws IOException {
            // 就可以通过 File 对象进行操作了.
            File file = new File("./cat.jpg");
            System.out.println(file.getParent());
            System.out.println(file.getName());
            System.out.println(file.getPath());
            System.out.println(file.getAbsolutePath());
            System.out.println(file.getCanonicalPath());
            Scanner scanner=new Scanner(InputStream);
        }
    }
}
